# -------------------------------------------------------------------------------------------------------------
# CMakeLists.txt for compiler project.
# -------------------------------------------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8)

# -------------------------------------------------------------------------------------------------------------
# <project>
# -------------------------------------------------------------------------------------------------------------
project(compiler CXX)
# -------------------------------------------------------------------------------------------------------------
# <project/>
# -------------------------------------------------------------------------------------------------------------

# -------------------------------------------------------------------------------------------------------------
# <source files>
# -------------------------------------------------------------------------------------------------------------
set(${PROJECT_NAME}_SOURCES
    main.cpp
    parser.cpp
    scanner.cpp
    Driver.cpp
    ExecutionResult.cpp
    ExpressionValue.cpp
    InterpreterVisitor.cpp
    CompilerVisitor.cpp
    ParseHelper.cpp
    Util.cpp
    tree/ArrayAccess.cpp
    tree/Assign.cpp
    tree/BinaryOperation.cpp
    tree/ClassDefinition.cpp
    tree/ConstantValue.cpp
    tree/EmptyStatement.cpp
    tree/Expression.cpp
    tree/FieldAccess.cpp
    tree/FieldDeclaration.cpp
    tree/ForLoop.cpp
    tree/FunctionCall.cpp
    tree/FunctionDefinition.cpp
    tree/IfStatement.cpp
    tree/MethodCall.cpp
    tree/MethodDefinition.cpp
    tree/NewExpression.cpp
    tree/ReturnStatement.cpp
    tree/Statement.cpp
    tree/StatementList.cpp
    tree/UnaryOperation.cpp
    tree/VarDeclaration.cpp
    tree/Variable.cpp
    tree/WhileLoop.cpp
)
# -------------------------------------------------------------------------------------------------------------
# <source files/>
# -------------------------------------------------------------------------------------------------------------

# -------------------------------------------------------------------------------------------------------------
# <header files>
# -------------------------------------------------------------------------------------------------------------
set(${PROJECT_NAME}_HEADERS
    ../common/Instruction.h
    parser.h
    scanner.h
    BuiltInFunctionType.h
    Driver.h
    FlexLexer.h
    Exceptions.h
    ExecutionResult.h
    ExpressionValue.h
    GeneralVisitor.h
    InterpreterVisitor.h
    CompilerVisitor.h
    ParseHelper.h
    Util.h
    ValueType.h
    Constants.h
    tree/ArrayAccess.h
    tree/Assign.h
    tree/BinaryOperation.h
    tree/BinaryOperationType.h
    tree/ClassDefinition.h
    tree/ConstantValue.h
    tree/EmptyStatement.h
    tree/Expression.h
    tree/ExpressionType.h
    tree/FieldAccess.h
    tree/FieldDeclaration.h
    tree/ForLoop.h
    tree/FunctionCall.h
    tree/FunctionDefinition.h
    tree/GeneralVariable.h
    tree/IfStatement.h
    tree/MethodCall.h
    tree/MethodDefinition.h
    tree/NewExpression.h
    tree/ReturnStatement.h
    tree/Statement.h
    tree/StatementList.h
    tree/TreeNode.h
    tree/UnaryOperation.h
    tree/UnaryOperationType.h
    tree/VarDeclaration.h
    tree/Variable.h
    tree/WhileLoop.h
)
# -------------------------------------------------------------------------------------------------------------
# <header files/>
# -------------------------------------------------------------------------------------------------------------

# -------------------------------------------------------------------------------------------------------------
# <includes>
# -------------------------------------------------------------------------------------------------------------
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}
)

# -------------------------------------------------------------------------------------------------------------
# </includes>
# -------------------------------------------------------------------------------------------------------------

# -------------------------------------------------------------------------------------------------------------
# <groups>
# -------------------------------------------------------------------------------------------------------------
source_group(Sources    REGULAR_EXPRESSION ".*\\.cpp$|.*\\.h$")
# -------------------------------------------------------------------------------------------------------------
# </groups>
# -------------------------------------------------------------------------------------------------------------

# -------------------------------------------------------------------------------------------------------------
# <target>
# -------------------------------------------------------------------------------------------------------------
add_executable(${PROJECT_NAME}
    ${${PROJECT_NAME}_SOURCES}
    ${${PROJECT_NAME}_HEADERS}
)

#target_link_libraries(${PROJECT_NAME} libname1 libname2 ...) 

# -------------------------------------------------------------------------------------------------------------
# <target/>
# -------------------------------------------------------------------------------------------------------------

# -------------------------------------------------------------------------------------------------------------
# <install files>
# -------------------------------------------------------------------------------------------------------------
install(TARGETS ${PROJECT_NAME} DESTINATION bin)

# -------------------------------------------------------------------------------------------------------------
# </install files>
# -------------------------------------------------------------------------------------------------------------
